package tt.dz.order.vo;

import java.math.BigDecimal;

import org.apache.commons.lang.StringUtils;

import tt.dz.order.exception.ParamLackException;
import tt.dz.order.exception.ParamNotFoundInSystemException;

/**
 * @Title: 白名单用户使用合作建设资源的打折信息
 * @author zhoutian
 * @date 2015-11-26
 */
public class WhiteListInfo extends BaseVo {
	// 用户id
	private String userId;
	// 资源（桩）所属运营商编号
	private String serviceProviderCode;
	// 折扣
	private BigDecimal discount;

	public String getUserId() {
		return userId;
	}

	public void setUserId(String userId) {
		this.userId = userId;
	}

	public String getServiceProviderCode() {
		return serviceProviderCode;
	}

	public void setServiceProviderCode(String serviceProviderCode) {
		this.serviceProviderCode = serviceProviderCode;
	}

	public BigDecimal getDiscount() {
		return discount;
	}

	public void setDiscount(BigDecimal discount) {
		this.discount = discount;
	}

	public WhiteListInfo() {
	}

	public void validate() throws ParamLackException, ParamNotFoundInSystemException {
		if (StringUtils.isBlank(userId)) {
			throw new ParamLackException("userId为空");
		}
		if (StringUtils.isBlank(serviceProviderCode)) {
			throw new ParamLackException("serviceProviderCode为空");
		}
		if (discount == null) {
			throw new ParamLackException("discount为空");
		}
	}
}